package com.sauro.common.exception;

import com.sauro.common.model.dto.Result;

/**
 * sauro 自定义异常
 *
 * @author liuxk
 * @date 2022/12/23
 */
public class SauroException extends RuntimeException {
    private Result result;

    public SauroException() {
        super();
    }

    public SauroException(String msg) {
        super(msg);
    }

    public SauroException(Result result) {
        super(result.getMsg());
        this.result = result;
    }

    public static SauroException error(String msg) {
        return new SauroException(Result.error(msg));
    }

    public Result getResult() {
        return result;
    }

    public void setResult(Result result) {
        this.result = result;
    }
}
